#include <gtk/gtk.h>
#include <stdio.h>

#include "gtkutils.h"

void sayHello() {
    printf("hello word\n");
}

static void activate(GtkApplication *app, gpointer user_data) {
    GtkWindow *window;

    window = createWindowWithTitleSize(app, "template", 200, 100);
    // window = gtk_application_window_new(app);
    // gtk_window_set_title(GTK_WINDOW(window), "template");
    // gtk_window_set_default_size(GTK_WINDOW(window), 200, 100);
    // gtk_widget_show(window);

    setWindowChild(window, createButtonAction(NULL, "Hello World", sayHello));

    showWindow(window);
}

int	main(int argc, char **argv) {

    GtkApplication *app;
    int status;

    app = createApplicationConnectActivate("gtk.example.template", 
                                G_APPLICATION_FLAGS_NONE, activate);
    // app = gtk_application_new("gtk.example.template", G_APPLICATION_FLAGS_NONE);
    // g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
    // status = g_application_run(G_APPLICATION(app), argc, argv);
    // g_object_unref(app);
    status = runApplication(app, argc, argv);
    objectUnref(app);

    return status;
}

